package Value类型

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object filter {

    def main(args: Array[String]): Unit = {

        val config: SparkConf = new SparkConf().setMaster("local[*]").setAppName("WordCount")

        val sc = new SparkContext(config)

        val rdd = sc.parallelize(1 to 16, 4)

        val filterRDD: RDD[Int] = rdd.filter(i => i % 2 == 0)//为true保留

        filterRDD.collect().foreach(println)


    }

}
